<?php

include ("../lib/BLL/DonViBLL.php");
include ("../lib/BLL/DmNganhBLL.php");
include ("../lib/BLL/DonViHocVuBLL.php");
include ("../lib/BLL/DmMonHocBLL.php");
include ("../lib/BLL/DmCaHocBLL.php");
include ("../lib/BLL/KhoaHocBLL.php");
include ("../lib/BLL/LopMonBLL.php");
include ("../lib/BLL/CanBoBLL.php");
include ("../lib/BLL/QuaTrinhLopMonBLL.php");
include ("../lib/BLL/ChiTietLopMonBLL.php");

$donvi=new DonViBLL();
$nganh=new DmNganhBLL();
$dvhv=new DonViHocVuBLL();
$monhoc= new DmMonHocBLL();
$cahoc= new DmCaHocBLL();
$khoahoc= new KhoaHocBLL();
$canbo= new CanBoBLL();
$lopmonBLL=new LopMonBLL();
$quatrinhlopmonBLL=new QuaTrinhLopMonBLL();
$ctlm= new ChiTietLopMonBLL();

$lopmonDAL=new LopMon();
$quatrinhlopmonDAL=new QuaTrinhLopMon();
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$

if(isset($_GET['xoalich'])){
    $nhomlich=$_GET['xoalich'];
    $sql="DELETE FROM tbl_laplich WHERE nhomlich_laplich='$nhomlich'";
    mysql_query($sql);
    
    
}







//--------------------------------------------------------------------------------------------------------------------------------------
$laplich=null;
$ma_cb=$_SESSION['ma_cb'];
    $sql_lichhoc="  SELECT 	DISTINCT nhomlich_laplich,ten_donvi,hoten_cb,tbl_donvihocvu.*,tbl_laplich.nguoiduyet,khoahoc_lop,tbl_laplich.ma_cb
                    FROM 	tbl_laplich,tbl_lopmon,tbl_donvi,tbl_canbo,tbl_donvihocvu
                    WHERE 	tbl_lopmon.ma_lopmon=tbl_laplich.ma_lopmon
                    AND	    tbl_lopmon.ma_donvi=tbl_donvi.ma_donvi
                    AND	    tbl_laplich.ma_cb=tbl_canbo.ma_cb 
                    AND	    tbl_lopmon.ma_donvihocvu=tbl_donvihocvu.ma_donvihocvu";
    
    $ex_lichhoc=mysql_query($sql_lichhoc);
    if($ex_lichhoc){
        while($row=mysql_fetch_array($ex_lichhoc)){
            $laplich[]=$row;
        }
    }
$smarty->assign('laplich',$laplich);
$smarty->assign('ma_canbo',$ma_cb);    
///--------------------------------------------------------------------------
$smarty->display('daotao/canbo_lapkehoach.tpl');   
?>












